package edu.ccut.saturn.studio.wfg.command;

import org.eclipse.gef.commands.Command;
import org.eclipse.jface.dialogs.Dialog;

import edu.ccut.saturn.studio.wfg.model.Connection;
import edu.ccut.saturn.studio.wfg.wfgmodel.SaturnRouterNode;

public class OpenConnectionCommand extends Command {
	private Dialog dialog;
	private Connection shape;

	public OpenConnectionCommand(Dialog dialog, Connection shape) {
		this.dialog = dialog;
		this.shape = shape;
	}

	public void execute() {
		dialog.open();
	}

	public boolean canExecute() {
		if (dialog != null && shape != null&&shape.getSource() instanceof SaturnRouterNode)
			return true;
		else
			return false;
	}
}
